package com.wzw.springboot.principle.aware;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

/**
 * @author Wangzhiwen
 */
public class CustomBeanFactory implements BeanFactoryAware {

    private static BeanFactory beanFactory;

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        CustomBeanFactory.beanFactory = beanFactory;
        System.out.println("CustomBeanFactory implement BeanFactoryAware interface 拿到 beanFactory 对象" + beanFactory);
    }
}
